#include "Real.h"
#include <sstream>

namespace TreeExpression {

Real::Real(double _data) : Expression_CRTP<Real>(), data(_data) { }

Real::Real(const Real& copy) : Expression(copy), Expression_CRTP<Real>(copy), data(copy.data) { }

Real::~Real () { }

AutoPointer<Expression> Real::eval(CopyPointer<Context>&) {
	return AutoPointer<Expression>(new TreeExpression::Real(*this));
}

long double Real::getData() const {
	return data;
}

std::string Real::getHash() const {
	return "Real";
}

std::string Real::toString() const {
	std::ostringstream oss;
	oss << data;
	return oss.str();
}

}

